# Wrapper script for starting X11 attachment viewer/editor utilities
# Parts of this script require translation for non-English languages
#
# This file Copyright (c) 1992-94 Z-Code Software, a Division of NCD.
# Permission to use, copy, modify, and distribute this material
# for any purpose and without fee is hereby granted, provided
# that the above copyright notice and this permission notice
# appear in all copies, and that the name of Z-Code Software not
# be used in advertising or publicity pertaining to this
# material without the specific, prior written permission
# of an authorized representative of Z-Code. Z-CODE SOFTWARE
# MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY
# OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED "AS IS",
# WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
ttyinput=false
ttyoutput=true
# Look for a tty in the obvious places
if test -t 0
then
ttyinput=true
fi
if test -t 2
then
exec 3>/dev/null
exec 2>&3
elif test -t 1
then
exec 3>/dev/null
exec 1>&3
elif $ttyinput
then
exec 3>/dev/null
exec 0>&3
else
ttyoutput=false
fi
# See if the DISPLAY veriable is set
if test -z "$DISPLAY"
then
if $ttyoutput
then
exec 3>&1
echo ""
echo This message part contains data which can currently be viewed
echo only when running X11. If you read this message while running
echo X11, and have your DISPLAY variable set, you will then be able
echo to view the message part properly.
echo ""
fi
exit 1
fi
# Everything looks OK -- run the argument list as a command
if [ "`whoami`" = "root" ]; then
xconfirm -t "This attachment type can contain embedded commands. Therefore," -t "as a security precaution, MediaMail will not display this attachment" -t "when MediaMail is launched by the super user." -header MediaMail -icon warning -b OK -c 1>/dev/null
else
case `xconfirm -t "This attachment type can contain embedded commands. Therefore," -t "displaying this attachment may enable a breach in the security" -t "of your system. Display anyway?" -header MediaMail -icon warning -b No -b Yes -c`